<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org/">
<head>
    <script type="text/javascript" th:src="@{https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js}"></script>
    <link th:href="@{https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css}" rel="stylesheet"/>
    <link th:href="@{/css/default.css}" rel="stylesheet"/>
    <meta charset="UTF-8"/>
    <title>书籍列表</title>
</head>
<body>

<div class="contentDiv">

    <h5> 《Spring Boot 2.x 核心技术实战 - 上 基础篇》第 4 章《模板引擎》Demo </h5>

    <table class="table table-hover table-condensed">
        <legend>
            <strong>菜单列表</strong>
        </legend>
        <thead>
        <tr>
            <th>菜单编号</th>
            <th>菜单级别</th>
            <th>菜单名称</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="menu : ${menuList}">
            <th scope="row" th:text="${menu.menuId}"></th>
            <td th:text="${menu.menuLevel}"></td>
            <td th:text="${menu.menuName}"></td>
            <td><a class="btn btn-danger" th:href="@{/book/delete/{bookId}(bookId=${menu.menuId})}">删除</a></td>
        </tr>
        </tbody>
    </table>

    <button type="button" class="btn btn-primary"  th:onclick="exportExcel([[${menuId}]])">测试按钮</button>
    <div><a class="btn btn-primary" href="/download" role="button">下载Excel</a></div>

    <div class="contentDiv">
        <form th:action="@{/upload}" enctype="multipart/form-data" method="post">
            <div class="form-group">
                <input id="file" name="file" type="file" multiple/>
            </div>
            <button type="submit" class="btn btn-default">Submit</button>
        </form>
    </div>


</div>

<script type="text/javascript">
   function exportExcel(menuId) {
       console.log("hhhhhhhhhhhhhhhhhh")
       console.log(menuId)
       $.get("/exportByWeb",{menuId:menuId},function (data) {
       });
   } 
</script>
</body>

</html>